#!/bin/sh

if [ ! -L /usr/lib/node_modules/node-red/nodes/dnp3 -a -L /usr/lib/node_modules/node-red ]; then
  ln -s /opt/nodereddnp3/lib/node_modules/node-red/nodes/dnp3 /usr/lib/node_modules/node-red/nodes/dnp3
fi

# If it isn't firmware update and it isn't called from Node-RED install script
if [ -z "$FIRST_START" -a "$1" != "norestart" ]; then
  /opt/nodered/etc/init restart
fi

